package cn.ylz.ylmall.content.dao.persist.mapper;

import cn.ylz.ylmall.content.pojo.entity.Content;
import cn.ylz.ylmall.content.pojo.param.ContentAddNewParam;
import cn.ylz.ylmall.content.pojo.vo.ContentListItemVO;
import cn.ylz.ylmall.content.pojo.vo.ContentStandardVO;
import cn.ylz.ylmall.content.pojo.vo.CountVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ContentMapper extends BaseMapper<Content> {

    /**
     * 根据id查询内容详情
     * @param id
     * @return
     */
    ContentStandardVO getStandardById(Long id);

    List<ContentListItemVO> list();

    List<ContentListItemVO> listByCategoryId(Long categoryId);

    /**
     * 更新浏览量
     * @param id
     * @return
     */
    int updateViewCount(Long id);


    void updateCount(Long id,Long likeCount,Long commentCount,Long collectCount);


    int updateContent(Long id,ContentAddNewParam contentAddNewParam);
}
